﻿using Microsoft.AspNetCore.Http;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Caching.Distributed;
using Microsoft.Extensions.Logging;

namespace Devonline.AspNetCore;

/// <summary>
/// Provides functionality for managing credentials, including operations with attachments, caching,  and HTTP context
/// integration. This service is designed to work with a specific database context  and supports distributed caching and
/// file handling.
/// </summary>
/// <remarks>This service extends <see cref="DataWithAttachmentService{TDbContext, Credential}"/> and implements 
/// <see cref="IDataWithAttachmentService{TDbContext, Credential}"/> to provide additional capabilities  for handling
/// credential-related data with attachments.</remarks>
/// <typeparam name="TDbContext">The type of the database context used by the service. Must derive from <see cref="DbContext"/>.</typeparam>
/// <param name="logger"></param>
/// <param name="context"></param>
/// <param name="cache"></param>
/// <param name="httpContextAccessor"></param>
/// <param name="fileService"></param>
/// <param name="httpSetting"></param>
public class CredentialService<TDbContext>(
    ILogger<CredentialService<TDbContext>> logger,
    TDbContext context,
    IDistributedCache cache,
    IHttpContextAccessor httpContextAccessor,
    IFileService fileService,
    HttpSetting httpSetting) :
    DataWithAttachmentService<TDbContext, Credential>(logger, context, cache, httpContextAccessor, fileService, httpSetting),
    IDataWithAttachmentService<TDbContext, Credential>
    where TDbContext : DbContext
{
}